change RotatingFileHandler to TimedRotatingFileHandler to support rotation of disk log files at certain timed intervals.

Brightcells 9 years ago
parent
commit
5a0b6447ca
1 changed files with 3 additions and 3 deletions
  1. 3 3
      pai2/settings.py

+ 3 - 3
pai2/settings.py

@@ -181,11 +181,11 @@ LOGGING = {
181 181
     'handlers': {
182 182
         'logit': {
183 183
             'level': 'DEBUG',
184
-            'class': 'logging.handlers.RotatingFileHandler',
184
+            'class': 'logging.handlers.TimedRotatingFileHandler',
185 185
             'filename': '/tmp/logit.log',
186
-            'maxBytes': 15728640,  # 1024 * 1024 * 15B = 15MB
186
+            'when': 'midnight',
187 187
             'backupCount': 10,
188
-            'formatter': 'verbose'
188
+            'formatter': 'verbose',
189 189
         },
190 190
     },
191 191
     'loggers': {